<div class="bjui-pageContent">
    <table id="canteen-list" class="table table-bordered" data-toggle="datagrid" data-options="{
        height: '100%',
        dataUrl: '/admin/administration/canteen-list',
        paging: {showPagenum:10, selectPageSize:'20,50,100', pageCurrent:1, pageSize:20},
        fullGrid: true,
        linenumberAll: true,
        showToolbar: true,
        toolbarCustom: toolbar,
        filterThead:false,
        fieldSortable:false,
        columnMenu:false
    }">
        <thead>
        <tr>
            <th data-options="{name:'a',align:'center',width:100}">名称</th>
            <th data-options="{name:'b',align:'center',width:100}">承包人</th>
            <th data-options="{name:'c',align:'center',width:100}">餐位</th>
            <th data-options="{name:'d',align:'center',width:100}">状态</th>
            <th data-options="{align:'center',width:100,render:operationColumn}">操作</th>
        </tr>
        </thead>
    </table>
</div>
<script type="text/javascript">
    function operationColumn(value, data) {
        var html = '<button type="button" class="btn btn-green" data-toggle="dialog" data-options="{id:\'canteen-edit\', url:\'/admin/administration/canteen-edit\', mask:true, width:525, height:315, title:\'编辑食堂\', data:{id:' + data.id + '}}"><i class="fa fa-edit"></i> 编辑</button>';
        return html;
    }
    function toolbar() {
        var html = '<button type="button" class="btn btn-blue"  data-toggle="dialog" data-options="{id:\'canteen-add\', url:\'/admin/administration/canteen-add\', title:\'添加食堂\', width:525, height:315, mask:true}"><i class="fa fa-plus"></i> 添加</button>';
        html += ' <button type="button" class="btn btn-blue"  data-toggle="navtab" data-options="{id:\'canteen-goods-list\', url:\'admin/canteen/goods/list\', title:\'食材统计\', fresh:true}" ><i class="fa fa-eye"></i> 食材统计</button>';
        html += ' <button type="button" class="btn btn-blue"  data-toggle="navtab" data-options="{id:\'canteen-pre-order-statistics-list\', url:\'admin/canteen/pre-order/statistics-list\', title:\'用餐统计\', fresh:true}"><i class="fa fa-eye"></i> 用餐统计</button>';
        return html;
    }
</script>